import 'package:flutter/material.dart';
class DemoList extends StatefulWidget {
  const DemoList({Key? key}) : super(key: key);

  @override
  State<DemoList> createState() => _DemoListState();
}
class Demo{
  String? url;
  String? name;
  Demo({this.url,this.name});
}

class _DemoListState extends State<DemoList> {
  List<Demo> demolist = [
    Demo(url:'/loading',name:'国家日期实战'),
    Demo(url:'/firstPage',name:'路由跳转'),
    Demo(url:'/scaffold',name:'Scaffold 组件来构建应用的基本页面'),
    Demo(url:'/appbar',name:'flutter 中appbar的详细使用'),
    Demo(url:'/text',name:'flutter 中文本显示 Text 组件的详细使用'),
    Demo(url:'/textfield',name:'flutter文本输入框TextField详细综述'),
    Demo(url:'/raisedButton',name:'RaisedButton是一个material风格”凸起“的按钮'),
    Demo(url:'/button',name:'按钮'),
    Demo(url:'/card',name:'card 卡片'),
    Demo(url:'/Container',name:'Container 容器'),
    Demo(url:'/cupertino',name:'CupertinoActionSheet 底部弹出的提示框'),
    Demo(url:'/column',name:'Colunm 布局'),
    Demo(url:'/row',name:'Row 布局'),
    Demo(url:'/Columnrow',name:'Column Row 布局'),
    Demo(url:'/stack',name:'Stack  绝对布局'),
    Demo(url:'/image',name:'Image的使用'),
    Demo(url:'/wrapDemo',name:'wrap流式布局'),
    Demo(url:'/rowDemo',name:'权重组件(Flexible、Expanded、Spacer)'),
    Demo(url:'/checkbox',name:'checkBox复选框的使用'),
    Demo(url:'/radio',name:'Radio单选框的使用'),
    Demo(url:'/gesture',name:'手势处理GestureDetector'),
    Demo(url:'/switch',name:'switch基本使用'),
    Demo(url:'/tabDemo',name:'TabBar 和 TabBarView'),
    Demo(url:'/singView',name:'SingleChildScrollView使用分析'),
    Demo(url:'/nestView',name:'滑动布局NestedScrollView与SliverAppBar使用分析'),
    Demo(url:'/nestView2',name:'NestedScrollView 页面滚动吸顶详解'),
    Demo(url:'/custom',name:'CustomScrollView 页面滚动'),
    Demo(url:'/custom2',name:'CustomScrollView 页面基本用法'), 
    Demo(url:'/listView',name:'ListView列表式布局'), 
    Demo(url:'/listView2',name:'ScrollController在ListView中使用'), 
    Demo(url:'/listView3',name:'下拉刷新组件SmartRefresher使用分析'), 
    Demo(url:'/gridView',name:'GridView组件的基本使用'), 
    Demo(url:'/clip',name:'圆形裁剪ClipOval组件的使用'),
    Demo(url:'/animation',name:'动画'),
    Demo(url:'/progress',name:'进度条使用'),
    Demo(url:'/fromWidget',name:'表单案例'),
    Demo(url:'/slider',name:'滑动使用'),
    Demo(url:'/stepper',name:'Flutter Stepper 步骤'),
    Demo(url:'/cuper',name:'分段控件 CupertinoSegmentedControl'),
    Demo(url:'/tooltip',name:'Tooltip 小提示组件 长按显示 有振动触觉'),
    Demo(url:'/physica',name:'PhysicalModel 为任意的Widget添加阴影'),
    Demo(url:'/slidable',name:'Slidable 列表侧滑菜单 列表侧滑删除'),
    Demo(url:'/listviewFag',name:'ListView 获取当前显示的Widget位置'),
    Demo(url:'/dateTime',name:'日期范围选择'),
    Demo(url:'/phone',name:'电话小控件'),
    Demo(url:'/will',name:'WillPopScope 双击返回与界面退出提示'),
    Demo(url:'/stream',name:'StreamBuilder 实现页面的局部刷新'),
    Demo(url:'/loadingI',name:' 动态加载 loading'),
    Demo(url:'/badge',name:' badge实现小红点提示'),
    Demo(url:'/imageshow',name:'图片浏览器 双指放大图片'),
    Demo(url:'/main',name:'仿抖音APP首页面'),
    Demo(url:'/dioGet',name:'网络请求dio get请求'),
    Demo(url:'/share',name:'数据存储'),
    Demo(url:'/welcome',name:'倒计时页面'),
    Demo(url:'/homePage',name:'首页'),
    Demo(url:'/guild',name:'引导页面'),
    Demo(url:'/getR',name:'GetX 路由管理'),
    Demo(url:'/getX',name:'GetX 状态管理基本使用'),
    Demo(url:'/getRx',name:'GetX 响应式编程'),
    Demo(url:'/getD',name:'状态管理GetX 工作流 搜索框的实时搜索'),
    Demo(url:'/getS',name:'状态管理 GetX 商品列表页面 UI构建'),
    Demo(url:'/fromI',name:'学员信息登记系统'),
    Demo(url:'/swiper',name:'轮播图插件案例'),
    Demo(url:'/dialog',name:' Dialog  AlertDialog 、SimpleDialog、showModalBottomSheet、showToast'),
    Demo(url:'/dioDemo',name:'请求数据Demo-Dio'),
    Demo(url:'/moreDemo',name:'下拉刷新 上拉分页加载更多'),
    Demo(url:'/YHDemo',name:'仿银行APP 首页界面设计'),
    Demo(url:'/login',name:'登录界面设计'),
    Demo(url:'/yiqing',name:'疫情界面UI'),
    Demo(url:'/travel',name:'旅游界面UI'),
    Demo(url:'/shopping',name:'商城界面UI'),
    Demo(url:'/shoe',name:'购物详情页面'),
   



  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor:Colors.blue[900],
        title: Text("Demo列表"),
        centerTitle: true,
        elevation: 0,
      ),
      body:ListView.builder(
        itemCount: demolist.length,
        itemBuilder: ((context, index) => 
          Padding(padding: EdgeInsets.symmetric(vertical: 1.0,horizontal: 4.0),
            child: ListTile(
              onTap: (){
                Navigator.pushNamed(context, demolist[index].url as String);
              },
              title: Text(demolist[index].name as String),
            ),
          )
        )
        
        )
    );
  }
}